<%@page import="com.winexpress.account.Customer"%>
<%@page import="com.winexpress.util.SessionAttributes"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>wineXpress Admin Home</title>

    </head>
    <body>
        <t:adminNavigation/>
        <br/>
        <div class="panel panel-default" style="width:70%; margin-left: 15%; margin-top: 10px">
            <div class="panel-heading">
                <h3 class="panel-title">Customer Detail </h3>
            </div>

            <div class="panel-body">
                <% Customer customer = (Customer) request.getAttribute("customer");
                    if (customer != null) {
                %>
                <form class="form-horizontal" role="form" id="defaultForm"  name="register" method="post">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">User ID</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="email" value="<%= customer.getId()%>" disabled>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">Email</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="email" value="<%= customer.getEmail()%>" disabled>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">First Name</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="email" value="<%= customer.getFirstName()%>" disabled>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">Last Name</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="email" value="<%= customer.getLastName()%>" disabled>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">Age</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="email" value="<%= customer.getAge()%>" disabled>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">Phone Number</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="email" value="<%= customer.getPhoneNumber()%>" disabled>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">Address</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="email" value="<%= customer.getAddress()%>" disabled>
                        </div>
                    </div>
                </form>
                <form class="form-horizontal" role="form" id="customerDetial"  name="customerDetial" action="/WineXpressClient/historyOrder/viewHistoryOrder" target="_blank" method="post"> 
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-sm">View Customer Order History</button>
                        </div>
                    </div>                   
                    <input type="hidden" name="id" value="<%= customer.getId()%>">
                </form>
                <%} else {%>
                <div class="alert alert-danger">Cannot find customer</div>
                <%}%>
            </div>
        </form>
    </div>
</body>
</html>
